<?php
declare (strict_types = 1);

namespace app\common\validate\Product;

use think\Validate;

class Vip extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'proid' => 'require',
        'level' => 'require|egt:0|number',
        'price' => 'require|egt:0|float'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'proid.require' => '未知商品',
        'level.require' => 'vip等级必填',
        'level.egt' => 'vip等级不能小于0',
        'price.require' => 'vip价格必填',
        'price.egt' => 'vip价格不能小于0'
    ];
    protected $scene = [
        'edit'  =>  ['level','price'],
    ];
}
